UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/1MhMnGa1/J0A7vydlziHqPFCaokc3iNvxDCm4YtDlQ='
WHERE
key_id = 'f6815659f320167a174756a929853d26d4610c17a639ba257814dbcafb23ddc3'
AND (
token = '/1MhMnGa1/J0A7vydlziHqPFCaokc3iNvxDCm4YtDlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)