UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Au3wwvkkTEu1q4J2OFK3f6N5mIXEYLwJbmZ/DU0gLmI='
WHERE
key_id = 'e50f09e533ba96d8ebdb9b6ecce4e53a47d942cfcad825757716a02c6886bed6'
AND (
token = 'Au3wwvkkTEu1q4J2OFK3f6N5mIXEYLwJbmZ/DU0gLmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)