UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L1lhy59ygLS8vNXtalgNXHli6WNMb6qHrrZ2MBtsmfk=' 
WHERE 
  key_id = 'b6e1180651363b564c4f3f8c077bc6c63c4852f1b70b4e6c2b4704243cdaa116' 
  AND (
    token = 'L1lhy59ygLS8vNXtalgNXHli6WNMb6qHrrZ2MBtsmfk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030