UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2RtD+3dGuuCAC0Erna2j/vCtedRxZ08crOXITYnYxLA='
WHERE
key_id = '9512bd236b655dfb9b69f214e6c20816204c442aada8561c0fd81ef2114e4e01'
AND (
token = '2RtD+3dGuuCAC0Erna2j/vCtedRxZ08crOXITYnYxLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)