UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Aw0W49bw4yKbQjF38rA88dVf8hUsg23yRWw+DOgpiII=' 
WHERE 
  key_id = 'e77bec7ecce3ef1e52e0de16b103c2b5bc091e437748ddd13eba60797e6161da' 
  AND (
    token = 'Aw0W49bw4yKbQjF38rA88dVf8hUsg23yRWw+DOgpiII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018