UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z3yrg01Uy1QkH/7zekBPOLOX00ZD47XJFKcBQffuyd8='
WHERE
key_id = '09e22c5af8511a7b219eb3ac14392f3edcf0a7071d77f0d41131c62354f6bd37'
AND (
token = 'z3yrg01Uy1QkH/7zekBPOLOX00ZD47XJFKcBQffuyd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)