UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tKOHAAuIBPkMIZAJ9oMb7AKo893Y7TuxFJiDN4Q2zBE=' 
WHERE 
  key_id = '19c5e89c293d649a65db385aef5bfd05d21895f932793546a5c636568b8f9cd3' 
  AND (
    token = 'tKOHAAuIBPkMIZAJ9oMb7AKo893Y7TuxFJiDN4Q2zBE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047