UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j0kiW8RzJGumYM3GijPfs4cwsjbhOjXS2svq21JeKVs='
WHERE
key_id = 'c5c66a5d72b216e1f3f202b52a7668d83f3b9aac6a43ee090fb38041c0a2bd91'
AND (
token = 'j0kiW8RzJGumYM3GijPfs4cwsjbhOjXS2svq21JeKVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)