UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fk2hlEWvakFSKV60SnFwR5BPDWAHqUaN0g+CcmEy6Xg='
WHERE
key_id = 'a6335a33f1c83a4c1d5ce2d64c574f35aed60f0ce221cfd412850c1a59ce9e9e'
AND (
token = 'Fk2hlEWvakFSKV60SnFwR5BPDWAHqUaN0g+CcmEy6Xg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)