UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WNUIFjJ1EOXbKipmxnR03HZeKcz4CYMYWFSiSJ6zT9g=' 
WHERE 
  key_id = '4073d75eb203024c69e19bbb7f2a270276f7bef154044485b1590f5069b10bf1' 
  AND (
    token = 'WNUIFjJ1EOXbKipmxnR03HZeKcz4CYMYWFSiSJ6zT9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016