UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q99tuRF0fosb2wZvJE4UUeT+2yBmyrUrJHNBHgVQiXg=' 
WHERE 
  key_id = '3ba0610c9469f8959ce93c723370481804d1e31ba6dfe2c8216cde119481b2c4' 
  AND (
    token = 'q99tuRF0fosb2wZvJE4UUeT+2yBmyrUrJHNBHgVQiXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027