UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Ccwrr1ZRVLbJU9F1cn47su2lEwgh7IaoygSzg/4NJA=' 
WHERE 
  key_id = 'a0746c97301db60ea4d750d709d1fb75f722635c1aaa963ad960fbdaf6ad3583' 
  AND (
    token = '6Ccwrr1ZRVLbJU9F1cn47su2lEwgh7IaoygSzg/4NJA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032