UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3SRJ8PtoKFJ29I3FPphDDFhpUSakv0vJSHgZ5eyc1uo='
WHERE
key_id = 'a2778b2066d4a5dc7c63f24d955734685a3c4c5e447fbf250b8fd4c35f89ac74'
AND (
token = '3SRJ8PtoKFJ29I3FPphDDFhpUSakv0vJSHgZ5eyc1uo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)