UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QLEwRHAdoTLB48ydbVQ9P2NVHSojWukkZho08a/LXRU='
WHERE
key_id = '3a3cd9ffbeb95dd2e22d751d30824840174171acded462ceff93642b391d5265'
AND (
token = 'QLEwRHAdoTLB48ydbVQ9P2NVHSojWukkZho08a/LXRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)