UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VrOfwdIbCSE04AkH8Hvmwz982BMLVElAr+t/NHrTPAU='
WHERE
key_id = '6fc9c132f2d5b33ad56f7d21bc373d19db5d02f44625e8ccab3656b6b6d3ca44'
AND (
token = 'VrOfwdIbCSE04AkH8Hvmwz982BMLVElAr+t/NHrTPAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)