UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Og0cf/3U0AdrNcPmF3JtArsJ0hevaejgMc69ANydezQ='
WHERE
key_id = 'cc0cd42f66404daef98d2ac98b7303ce9e2857b7aa000d94a47b2d12ad108034'
AND (
token = 'Og0cf/3U0AdrNcPmF3JtArsJ0hevaejgMc69ANydezQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)