UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1pXAkRdUwFwLVD4XyZ01f8zUqRu3a61QeKQkH7y7o+0='
WHERE
key_id = '90ec0c738e0247e55abdb0d6a36526e6c3402bb8d72d82f9c6e4c3177272a99f'
AND (
token = '1pXAkRdUwFwLVD4XyZ01f8zUqRu3a61QeKQkH7y7o+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)