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

Query time 0.00069