UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sYpF1rp32rjT/gofVwKGhlnZLN4V+PUY+bYwLfjSarA=' 
WHERE 
  key_id = 'd774354d8dd030e42d8d6761a92bbc50fd46cc82f7ea40c0ea134bf92694920a' 
  AND (
    token = 'sYpF1rp32rjT/gofVwKGhlnZLN4V+PUY+bYwLfjSarA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064