UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oYGwo9NCQpTovan5Xmb1QdagpB5a0Io26l611iH6/kM='
WHERE
key_id = 'a58c723cfea78b94e5bc6f707b10b9f25c493180cdeadc895d37c0a2d46a8d07'
AND (
token = 'oYGwo9NCQpTovan5Xmb1QdagpB5a0Io26l611iH6/kM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)