UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WOrENChIGhzgv/uIyXqkvfLmgZ8hL2NkREapjimn1fQ='
WHERE
key_id = '352a0f9b5657aac36b7144e0eae978749f217f22dcee2d964d9bee486a35856b'
AND (
token = 'WOrENChIGhzgv/uIyXqkvfLmgZ8hL2NkREapjimn1fQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)