UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zc2KAE8nymgH81AF4JwiNDJXmk3zO4famJ/6Q/SefkQ=' 
WHERE 
  key_id = '4a3de78c9965e2f3ee2758566a4bfb3be7fd1decef46e77c364389e5d91affac' 
  AND (
    token = 'Zc2KAE8nymgH81AF4JwiNDJXmk3zO4famJ/6Q/SefkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017