UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sedPKv28yc0wPZQdtszD1rU+jDXpvV5+SHucgxLr61s='
WHERE
key_id = 'cc49ad0baccde607e210ac3db54766f137df78b76eeb788562bb77c267618f9d'
AND (
token = 'sedPKv28yc0wPZQdtszD1rU+jDXpvV5+SHucgxLr61s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)