UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0FuQ+3bEoOtzvPPEVm7849FIupzqkMH8jY42A21aomM='
WHERE
key_id = '46dcac0b4e7c774369dff7234ace609e1baa479dd84f5cd853cef0966ee195d2'
AND (
token = '0FuQ+3bEoOtzvPPEVm7849FIupzqkMH8jY42A21aomM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)