UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CTgE9KHNCW+VjkESK6UdhQZsADByHZjr1ZBWCKV4H2w=' 
WHERE 
  key_id = '5b6d0bcf8a13b47e8ebd9b36c8aea331cc5641204c62b27c3659fe189e9b0e1a' 
  AND (
    token = 'CTgE9KHNCW+VjkESK6UdhQZsADByHZjr1ZBWCKV4H2w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031