UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o4xjyMTangbKYGhhwSjIwwsWC7dL73RjyNwOVDUyNjY='
WHERE
key_id = '9c28f0fdcca85f395e9750a736c40d8050083df836c901df1e5c6821c82a5e15'
AND (
token = 'o4xjyMTangbKYGhhwSjIwwsWC7dL73RjyNwOVDUyNjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)