UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZCVLs+uIEHyMBB0HT5wID/9M1MrzMSQOVBGhbY01xg8='
WHERE
key_id = '8ec87efdfdd844a695a6742a901918de6b842ecdee0df3407e646f71fd47ee3d'
AND (
token = 'ZCVLs+uIEHyMBB0HT5wID/9M1MrzMSQOVBGhbY01xg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)