UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GaKierrKR+QAPPZmNN6QBWOeTccEcGOkmwCiEwDqQKc='
WHERE
key_id = '42366fb13d99e264d7caf89a35edb6e0a55e6a35a1fbc282641edb1fddbb2fd7'
AND (
token = 'GaKierrKR+QAPPZmNN6QBWOeTccEcGOkmwCiEwDqQKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)