UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hIArdMSVZhUC4sRu5VTTP/8tjwvTqAEHXypoiZAiRaI='
WHERE
key_id = '292ca486bf0d10c3098e9c99cfec41e545a57d81a654dcfa1ceb329d14150860'
AND (
token = 'hIArdMSVZhUC4sRu5VTTP/8tjwvTqAEHXypoiZAiRaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)