UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F63xVhiEoqvkIiVrSrdhGa1e8WrJGJjm0UxFK4XMnm0='
WHERE
key_id = 'cf890af3c49ccf5ffe2dc4048bd513a534b19dd813be7a6aad3b5d81d27a79e2'
AND (
token = 'F63xVhiEoqvkIiVrSrdhGa1e8WrJGJjm0UxFK4XMnm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)