UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rlM3h9gWFHHHuC+TYJZ1n0zcdDdcdT8KEq4tPPNZvRs=' 
WHERE 
  key_id = 'ccebff99f98f8874d6c7bb565515ee3f61f39444fb4d219275dea6ae9521267f' 
  AND (
    token = 'rlM3h9gWFHHHuC+TYJZ1n0zcdDdcdT8KEq4tPPNZvRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017